package com.ruoyi.dash.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dash.mapper.TbPartyBuildingMapper;
import com.ruoyi.dash.domain.TbPartyBuilding;
import com.ruoyi.dash.service.ITbPartyBuildingService;

/**
 * 党建Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-25
 */
@Service
public class TbPartyBuildingServiceImpl implements ITbPartyBuildingService 
{
    @Autowired
    private TbPartyBuildingMapper tbPartyBuildingMapper;

    /**
     * 查询党建
     * 
     * @param id 党建主键
     * @return 党建
     */
    @Override
    public TbPartyBuilding selectTbPartyBuildingById(Long id)
    {
        return tbPartyBuildingMapper.selectTbPartyBuildingById(id);
    }

    /**
     * 查询党建列表
     * 
     * @param tbPartyBuilding 党建
     * @return 党建
     */
    @Override
    public List<TbPartyBuilding> selectTbPartyBuildingList(TbPartyBuilding tbPartyBuilding)
    {
        return tbPartyBuildingMapper.selectTbPartyBuildingList(tbPartyBuilding);
    }

    /**
     * 新增党建
     * 
     * @param tbPartyBuilding 党建
     * @return 结果
     */
    @Override
    public int insertTbPartyBuilding(TbPartyBuilding tbPartyBuilding)
    {
        tbPartyBuilding.setCreateTime(DateUtils.getNowDate());
        return tbPartyBuildingMapper.insertTbPartyBuilding(tbPartyBuilding);
    }

    /**
     * 修改党建
     * 
     * @param tbPartyBuilding 党建
     * @return 结果
     */
    @Override
    public int updateTbPartyBuilding(TbPartyBuilding tbPartyBuilding)
    {
        tbPartyBuilding.setUpdateTime(DateUtils.getNowDate());
        return tbPartyBuildingMapper.updateTbPartyBuilding(tbPartyBuilding);
    }

    /**
     * 批量删除党建
     * 
     * @param ids 需要删除的党建主键
     * @return 结果
     */
    @Override
    public int deleteTbPartyBuildingByIds(Long[] ids)
    {
        return tbPartyBuildingMapper.deleteTbPartyBuildingByIds(ids);
    }

    /**
     * 删除党建信息
     * 
     * @param id 党建主键
     * @return 结果
     */
    @Override
    public int deleteTbPartyBuildingById(Long id)
    {
        return tbPartyBuildingMapper.deleteTbPartyBuildingById(id);
    }
}
